import request from '@/utils/request'
import { transformQueryCondition } from '@/utils'

// 组织机构Tree
export function getOrgTree() {
  return request({
    url: '/api/tree/org',
    method: 'POST'
  })
}

// 插入
export function insertItem(data) {
  return request({
    url: '/api/OzOrgUserinfo',
    method: 'POST',
    data: data
  })
}

// 批量插入
export function batchInsertItem(data) {
  return request({
    url: '/api/OzOrgUserinfo/batch',
    method: 'POST',
    data: data
  })
}

// 复合检索
export function compositeSelect(query) {
  const searchCon = transformQueryCondition(query)
  return request({
    url: '/api/OzOrgUserinfo/compositeSelect',
    method: 'POST',
    data: searchCon
  })
}

// 求件
export function countSelect(query) {
  const searchCon = transformQueryCondition(query)
  return request({
    url: '/api/OzOrgUserinfo/count',
    method: 'POST',
    data: searchCon
  })
}

// 强制删除
export function forceDeleteItem(data) {
  return request({
    url: '/api/OzOrgUserinfo/force',
    method: 'DELETE',
    data: data
  })
}

// 批量强制删除
export function batchDeleteItem(data) {
  return request({
    url: '/api/OzOrgUserinfo/force/batch',
    method: 'DELETE',
    data: data
  })
}

// 检索
export function select(query) {
  const searchCon = transformQueryCondition(query)
  return request({
    url: '/api/OzOrgUserinfo/select',
    method: 'POST',
    data: searchCon
  })
}

// 更新
export function updateItem(id, data) {
  return request({
    url: '/api/OzOrgUserinfo/' + id,
    method: 'PUT',
    data: data
  })
}
